'use strict';

module.exports = app => {
  // 图片表
  const {INTEGER, STRING} = app.Sequelize;
  const Photo = app.model.define('s_photo', {
    id: {type: INTEGER, primaryKey: true, autoIncrement: true},
    point_id: {
      type: INTEGER,
      comment: '根据type来判断是谁的id',
    },
    user_id: {
      type: INTEGER,
      comment: '用户id',
    },
    project_id: {
      type: INTEGER,
      comment: '项目id',
    },
    sort_id: {
      type: STRING,
      comment: '排序id',
      defaultValue: 99999,
    },
    type: {
      type: STRING,
      comment: '1商品，2评价, 3轮播图, 4其他',
    },
    path: {
      type: STRING,
      comment: '图片路径',
    },
  });

  return Photo;
};
